<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>多选框</title>
    <script src="../js/jQuery.js"></script>
    <script>

        $(function(){
          var all =$("#all");
          all.click(function(){
            $("input[type='checkbox']").prop("checked",this.checked);
          })
        })
    </script>
    </script>
</head>
<body>
  <input type="checkbox" id="all"/><br/>
  <input type="checkbox"/><br/>
  <input type="checkbox"/><br/>
  <input type="checkbox"/><br/>
  <input type="checkbox"/><br/>
  <input type="checkbox"/><br/>
</body>
</html>